package com.turtle3d.gui;

import java.io.File;

import javax.swing.JFileChooser;

import com.turtle3d.App;

public class ObjFileChooser extends JFileChooser
{
	
	public ObjFileChooser(){
		super(new File("."));
	}
	
	public ObjFileChooser(File filePath){
		super(filePath);
	}
	
	/**
	 * 
	 * @return Obj file name, without extension
	 */
	public String getObjFileName(){
		String path = getSelectedFile().getPath();
		App.println(File.pathSeparator);
		return path.substring(path.lastIndexOf("/")+1, path.length());
		
	}
	
	public String getObjFilePath(){
		String path = getSelectedFile().getPath();
					
		return path.substring(0, path.lastIndexOf("/")+1);
	}
	
}
